﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using VemTransporte.Models.Basica;
using NHibernate;

namespace VemTransporte.Models.Persistencia
{
    public class RepEndereco : GenericNHibernateDAO<Endereco, int>
    {
        public Endereco ProcurarEnderecoPorCep(string cep)
        {
            Endereco retorno = null;

            IQuery query = Session.CreateQuery("from Endereco where END_Cep=:cep").SetString("cep", cep);

            retorno = query.UniqueResult<Endereco>();
           
            return retorno;
        }
    }
}